package com.wind.trademark.task.model;


import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.wind.trademark.base.model.BsCategory;
import com.wind.trademark.client.model.CtCompany;

/**
 * TkTask entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tk_task", catalog = "mypro")
public class TkTask implements java.io.Serializable {

	// Fields

	private Long id;
	private String code;
	private Long owner;
	private String status;
//	private Long categoryId;
	private BsCategory bsCategory;
	private CtCompany ctCompany;
	private String cnName;
	private String enName;
	private String taskName;
	private String description;
	private Long createBy;
	private Date createTime;
	private Date lastUpdateTime;
	private Long lastUpdateBy;
	private List<TkTaskContactor> tkTaskContactores=new ArrayList<TkTaskContactor>();

	// Constructors







	/** default constructor */
	public TkTask() {
	}


	// Property accessors
	@Id
	@GeneratedValue(generator = "generator")    
	@GenericGenerator(name = "generator", strategy = "increment") 
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}


	@Column(name = "OWNER", nullable = false)
	public Long getOwner() {
		return owner;
	}


	public void setOwner(Long owner) {
		this.owner = owner;
	}
	@Column(name = "CODE", length = 200)
	public String getCode() {
		return code;
	}


	public void setCode(String code) {
		this.code = code;
	}

//	@ManyToOne(fetch = FetchType.EAGER)
//	@JoinColumn(name = "CATEGORY_ID")
//	public Long getCategoryId() {
//		return categoryId;
//	}
//
//
//	public void setCategoryId(Long categoryId) {
//		this.categoryId = categoryId;
//	}
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "CATEGORY_ID")
	public BsCategory getBsCategory() {
		return bsCategory;
	}


	public void setBsCategory(BsCategory bsCategory) {
		this.bsCategory = bsCategory;
	}



	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "COMP_ID")
	public CtCompany getCtCompany() {
		return this.ctCompany;
	}

	public void setCtCompany(CtCompany ctCompany) {
		this.ctCompany = ctCompany;
	}

	@Column(name = "CN_NAME", nullable = false, length = 200)
	public String getCnName() {
		return this.cnName;
	}

	public void setCnName(String cnName) {
		this.cnName = cnName;
	}

	@Column(name = "EN_NAME", length = 200)
	public String getEnName() {
		return this.enName;
	}

	public void setEnName(String enName) {
		this.enName = enName;
	}

	@Column(name = "TASK_NAME", length = 800)
	public String getTaskName() {
		return taskName;
	}


	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}
	@Column(name = "STATUS", length = 10)
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "DESCRIPTION", length = 800)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "CREATE_BY", nullable = false,updatable=false)
	public Long getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(Long createBy) {
		this.createBy = createBy;
	}

	@Column(name = "CREATE_TIME", nullable = false, length = 19,updatable=false)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "LAST_UPDATE_TIME", nullable = false, length = 19)
	public Date getLastUpdateTime() {
		return this.lastUpdateTime;
	}

	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}

	@Column(name = "LAST_UPDATE_BY", nullable = false)
	public Long getLastUpdateBy() {
		return this.lastUpdateBy;
	}

	public void setLastUpdateBy(Long lastUpdateBy) {
		this.lastUpdateBy = lastUpdateBy;
	}


	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER, mappedBy = "taskId")
	public List<TkTaskContactor> getTkTaskContactores() {
		return tkTaskContactores;
	}


	public void setTkTaskContactores(List<TkTaskContactor> tkTaskContactores) {
		this.tkTaskContactores = tkTaskContactores;
	}
}